package com.zhang.zhangapp.base.http;


import android.os.Build;

import com.zhang.zhangapp.application.MApplication;
import com.zhang.zhangapp.base.config.HttpConfig;
import com.zhang.zhangapp.utils.SystemUtil;

import org.xutils.http.RequestParams;


/**
 * Created by 罗肖 on 2017/6/28.
 */
public class MHttpParams extends RequestParams {


    public MHttpParams() {
        super();
        // 添加公共参数
        //this.addBodyParameter("", "");
    }

    public MHttpParams(String methodName) {
        super(HttpConfig.HTTP + HttpConfig.HTTP_HOST + (HttpConfig.HTTP_PORT == null ? "" : (":" + HttpConfig.HTTP_PORT)) + HttpConfig.SERVER_PATH + methodName);
        // 添加公共参数
        //this.addBodyParameter("", "");
        this.addHeader("deviceType", "Android" + Build.BRAND + Build.MODEL);
        this.addHeader("deviceCode", SystemUtil.getUniquePsuedoID());
        this.addHeader("authStr", SystemUtil.getUniquePsuedoIDMD5());
        this.addHeader("tokens", MApplication.getInstance().getToken());

//        this.addBodyParameter("deviceType", "Android");
//        this.addBodyParameter("deviceCode", SystemUtil.getUniquePsuedoID());
//        this.addBodyParameter("authStr", SystemUtil.getUniquePsuedoIDMD5());
//        this.addBodyParameter("tokens", MApplication.getInstance().getToken());
    }
}
